<!DOCTYPE html>
<html>

<head>
    <title>统一认证平台</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${ctxPath}/assets/common/layui/css/layui.css"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/css/error-page.css"/>
</head>

<body>

<!-- 正文开始 -->
<div class="error-page">
    <img class="error-page-img" src="${ctxPath}/assets/common/images/ic_404.svg">
    <div class="error-page-info">
        <div class="error-page-info-desc">正在退出</div>
        <div>
            <span id="timeTotal" class="pr3">5</span>秒后返回统一认证平台首页或
            <input name="clientId" type="hidden" value="${clientInfo.clientId}">
            <input name="redirectUrl" type="hidden" value="${clientInfo.redirectUrl}">
            <a href="${clientInfo.redirectUrl}/">点击链接直接返回</a>
        </div>
    </div>
</div>

<!-- js部分 -->
@/* 加入contextPath属性和session超时的配置 */
<script type="text/javascript">
    var Feng = {
        ctxPath: "",
        addCtx: function (ctx) {
            if (this.ctxPath === "") {
                this.ctxPath = ctx;
            }
        }
    };
    Feng.addCtx("${ctxPath}");
</script>
<script type="text/javascript" src="${ctxPath}/assets/common/layui/layui.js"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/plugins/jquery/jquery-3.2.1.min.js"></script>

</body>

<script type="text/javascript">

    window.onload = function () {

        // 初始化内容
        console.log("init");
        var timeTotalObj = $("#timeTotal");
        var timeOutObj;

        function timeCountdown() {
            var timeValue = timeTotalObj.text();
            var timeValueInt = parseInt(timeValue);
            if (timeValueInt == 0) {
                gotoIndex();
                return;
            }
            timeTotalObj.text(timeValueInt - 1);
            timeOutObj = setTimeout(timeCountdown, 1000);
        }

        timeCountdown();
    };

    function gotoIndex() {
        location = "${clientInfo.redirectUrl}";
    }

</script>

</html>